/*********************************************************
This inputs data from the Prolific Survey we ran in Jan 2024
This survey concentrated on responses of parents (unlike previous surveys that concentrated on responses of decision-makers)
Qualtrics "Dec 2024 BGS labor market impact survey"

Created Jan 2025
Author Laura Gee

Updated May 27 2025
*********************************************************/
clear all

//-----------import data from Qualtrics
//Download from Qualtrics as Excel
	//Recode seen but unanswered questions as -99
	//Recode seen but unanswered multi-value fields as 0
	//Export viewing order data for randomized surveys
	//export viewing order data
	//Split multi-value fields into columns
//Qualtrics Sept 2024 BGS labor market impact survey

global data "$path/1_data"
clear 

cd "$data/3_decision_makers"
import excel "$data/3_decision_makers/Dec+2024+BGS+labor+market+impact+survey_February+15,+2025_08.37.xlsx", sheet("Sheet1") firstrow
save "$data/3_decision_makers/DM_Parent_Survey_Jan2025.dta", replace


save "$data/3_decision_makers/DM_Parent_Survey_Jan2025_clean.dta", replace

//------------Demographics (asked at end but coding first in case want to cut answers by this)

tab Gender	
gen Female=(Gender=="Female")
 
gen White_nonHisp=(Ethnicity_1!="0")
gen Black=(Ethnicity_2!="0")
gen AmIndian_Alaska=(Ethnicity_3!="0")
gen Asian=(Ethnicity_4!="0")
gen Hawaiian_Islander=(Ethnicity_5!="0")
gen Latino_Hisp=(Ethnicity_6!="0")
gen Other=(Ethnicity_7!="0")

destring Ethnicity_1 Ethnicity_2 Ethnicity_3 Ethnicity_4 Ethnicity_5 Ethnicity_6, force replace
	forvalues i = 1/6{
	replace Ethnicity_`i'=1 if Ethnicity_`i'==.
	}

gen TotalEthnicityMarked=Ethnicity_1+Ethnicity_2+Ethnicity_3+Ethnicity_4+Ethnicity_5+Ethnicity_6

gen WhiteOnly_nonHisp=White_nonHisp
	replace WhiteOnly_nonHisp=0 if TotalEthnicityMarked>1
gen BlackOnly=Black
	replace BlackOnly=0 if TotalEthnicityMarked>1
gen AmIndian_AlaskaOnly=AmIndian_Alaska
	replace AmIndian_AlaskaOnly=0 if TotalEthnicityMarked>1
gen AsianOnly=Asian
	replace AsianOnly=0 if TotalEthnicityMarked>1
gen Hawaiian_IslanderOnly=Hawaiian_Islander
	replace Hawaiian_IslanderOnly=0 if TotalEthnicityMarked>1
gen Latino_HispOnly=Latino_Hisp
	replace Latino_HispOnly=0 if TotalEthnicityMarked>1

tab Political
tab Education
tab ChildrenUnder18

tab Age
gen AgeContinious=(18+24)/2 if Age=="18 - 24"
	replace AgeContinious= (25+34)/2 if Age=="25 - 34"
	replace AgeContinious= (35+44)/2 if Age=="35 - 44"
	replace AgeContinious= (45+54)/2 if Age=="45 - 54"	
	replace AgeContinious= (55+64)/2 if Age=="55 - 64"
	replace AgeContinious= (65+74)/2 if Age=="65 - 74"	

gen Liberal=0 if Political!="Prefer not to state"
		replace Liberal=1 if Political=="Moderately liberal"
		replace Liberal=1 if Political=="Strongly liberal"
	
gen Conservative=0 if Political!="Prefer not to state"
		replace Conservative=1 if Political=="Moderately conservative"
		replace Conservative=1 if Political=="Strongly conservative"
		
gen Moderate=0 if Political!="Prefer not to state"
		replace Moderate=1 if Political=="Neither, middle of the road"
	
gen ChildUnder18=(ChildrenUnder18=="Yes")	

gen EducBAHighest=(Education=="Bachelor's degree")

	gen HighSchool=(Education=="High school diploma or equivalent")
	gen BA=(Education=="Bachelor's degree")
	gen GradDegree=(Education=="Graduate Degree")
	gen SomeCollegeORAssocDegree=0
		replace SomeCollegeORAssocDegree=1 if Education=="Some college"
		replace SomeCollegeORAssocDegree=1 if Education=="Associate's degree"

gen FullTimeWorker=(Dec24_Employment0=="Full-time employed (not as a stay-at-home parent)")



** Employment
//Currently, which of the following best describes your employment status:
tab Dec24_Employment0
	tab Dec24_Employment0 if MotherVFather=="Mother"
	tab Dec24_Employment0 if MotherVFather=="Father"

//At the time that your children were below 18 and living at home, which of the following best describes your employment status for the majority of that time:
tab Dec24_Employment1
	tab Dec24_Employment1 if MotherVFather=="Mother"
	tab Dec24_Employment1 if MotherVFather=="Father"

//At the time that your children were below 18 and living at home, were you ever out of the paid workforce and identified as a stay-at-home parent for more than 1 year?
tab Dec24_Employment2
	tab Dec24_Employment2 if MotherVFather=="Mother"
	tab Dec24_Employment2 if MotherVFather=="Father"

tab MotherVFather Gender // All who identify as "Mother" also choose Female & Almost all who identify as "Father" choose Male (1 person exception)	

//At the time that your children were below 18 and living at home, for approximately how many years did you identify as a stay-at-home parent?
	tab Dec24_Employment2A

gen CurrentStayAtHome=(Dec24_Employment0=="Stay-at-home parent")
gen EverStayAtHome1yearPlus=(Dec24_Employment2=="Yes, I was out of the paid workforce for at least one year as a stay-at-home parent")

gen CurrentStayAtHomeMom=CurrentStayAtHome if MotherVFather=="Mother"
gen CurrentStayAtHomeDad=CurrentStayAtHome if MotherVFather=="Father"

gen EverStayAtHome1yearPlusMom=EverStayAtHome1yearPlus if MotherVFather=="Mother"
gen EverStayAtHome1yearPlusDad=EverStayAtHome1yearPlus if MotherVFather=="Father"
	
// Summary Statistics
//We compare our sample to the general US population who are married and living together in households with at least one child under the age of 18. 

fsum Female AgeContinious CurrentStayAtHome CurrentStayAtHomeMom CurrentStayAtHomeDad EverStayAtHome1yearPlus EverStayAtHome1yearPlusMom EverStayAtHome1yearPlusDad FullTimeWorker White_nonHisp Black Latino_Hisp Asian Liberal Conservative Moderate EducBAHighest ChildUnder18 

fsum Female AgeContinious CurrentStayAtHome CurrentStayAtHomeMom CurrentStayAtHomeDad EverStayAtHome1yearPlus EverStayAtHome1yearPlusMom EverStayAtHome1yearPlusDad FullTimeWorker WhiteOnly_nonHisp BlackOnly Latino_HispOnly AsianOnly Liberal Conservative Moderate EducBAHighest ChildUnder18 

gen SvyEmpCat=.
	replace SvyEmpCat=1 if MotherVFather=="Mother"&(Dec24_Employment0=="Stay-at-home parent")
	replace SvyEmpCat=2 if MotherVFather=="Father"&(Dec24_Employment0=="Stay-at-home parent")	
	replace SvyEmpCat=3 if MotherVFather=="Mother"&(Dec24_Employment0!="Stay-at-home parent")
	replace SvyEmpCat=4 if MotherVFather=="Father"&(Dec24_Employment0!="Stay-at-home parent")

	label define SvyEmpCatl ///
						1 "Stay-at-home Mom" ///
						2 "Stay-at-home Dad" ///
						3 "Mom Other Employment" ///
						4 "Dad Other Employment"
	label values SvyEmpCat SvyEmpCatl	
	
	
tab SvyEmpCat	
//Ideal is 
		//1 "Stay-at-home Mom" /// .26*.51=.1326
		//2 "Stay-at-home Dad" /// .08*(1-.51)=.0392
		//3 "Mom Other Employment" /// (1-.26)*.51=.3774
		//4 "Dad Other Employment" /// (1-.08)*(1-.51)=.4508

bysort SvyEmpCat: gen temp_weight=_N 
gen temp_weight_denom=_N
gen temp_weight_2=temp_weight/temp_weight_denom
gen temp_weight_3=.
	replace temp_weight_3=.1326/temp_weight_2 if SvyEmpCat==1
	replace temp_weight_3=.0392/temp_weight_2 if SvyEmpCat==2
	replace temp_weight_3=.3774/temp_weight_2 if SvyEmpCat==3
	replace temp_weight_3=.4508/temp_weight_2 if SvyEmpCat==4
	
gen a_weight=temp_weight_3
drop temp_weight*

fsum Female AgeContinious CurrentStayAtHome CurrentStayAtHomeMom CurrentStayAtHomeDad EverStayAtHome1yearPlus EverStayAtHome1yearPlusMom EverStayAtHome1yearPlusDad FullTimeWorker WhiteOnly_nonHisp BlackOnly Latino_HispOnly AsianOnly Liberal Conservative Moderate EducBAHighest ChildUnder18 [aw=a_weight]

fsum Female AgeContinious CurrentStayAtHome CurrentStayAtHomeMom CurrentStayAtHomeDad EverStayAtHome1yearPlus EverStayAtHome1yearPlusMom EverStayAtHome1yearPlusDad FullTimeWorker WhiteOnly_nonHisp BlackOnly Latino_HispOnly AsianOnly Liberal Conservative Moderate EducBAHighest ChildUnder18	
	
tab SvyEmpCat 	[aw=a_weight]

// Resource Survey Weights: A Step-by-Step Guide to Calculation RICHARD VALLIANT JILL A. DEVER		
// svycal rake i.SvyEmpCat, gen(rake_wt) totals(_cons=10000 1.SvyEmpCat=1326 2.SvyEmpCat=392 3.SvyEmpCat=3774 4.SvyEmpCat==4508)
// matrix poptotals = 10000, 1326, 392, 3774, 4508
// matrix colnames poptotals = _cons 1.SvyEmpCat 2.SvyEmpCat 3.SvyEmpCat 4.SvyEmpCat 
// svycal regress i.SvyEmpCat, gen(ps_wt) totals(poptotals)
// svyset [pweight=ps_wt]
// svy: mean Female AgeContinious CurrentStayAtHome CurrentStayAtHomeMom CurrentStayAtHomeDad FullTimeWorker White_nonHisp Black Latino_Hisp Asian Liberal Conservative Moderate EducBAHighest ChildUnder18 

		
//----------- Randomizations -------------//
**Hypothetical Experiment 
	//Was the informational experiment the 1st part of survey ==1, otherwise it was last (before demographics)
	//50% liklihood
	destring InfoExpFirst, force replace
	sum InfoExpFirst
	//Which version of informational experiment was shown
	destring InfoExp, force replace

	//Dec24_InfoReactC1 only see "A recent study finds that when parents become more involved in their children's school lives by receiving regular information about their child's academic progress, their children develop more positive behavior in school. The messages that were used to communicate with the school were sent through a low-cost electronic technology."
	gen Dec24_InfoReactC1=0
		replace Dec24_InfoReactC1=1 if InfoExp>=1&InfoExp<=40
		
	//Dec24_InfoReactC2 only see a shorter version of contorl "A recent study finds that when parents become more involved in their children's school lives by receiving regular information about their child's academic progress, their children develop more positive behavior in school."
	gen Dec24_InfoReactC2=0
		replace Dec24_InfoReactC2=1 if InfoExp>80&InfoExp<=90		
	
	//Dec24_InfoReactT1 see info about our study "A recent study finds that when parents become more involved in their children's school lives by receiving regular information about their child's academic progress, their children develop more positive behavior in school. Another recent study finds that if the child's father emails the school and indicates that he has a lot of availability, about 90% of responses from the school will be directed to the father."	
	gen Dec24_InfoReactT1=0
		replace Dec24_InfoReactT1=1 if InfoExp>40&InfoExp<=80
		
	//Dec24_InfoReactT2 see info about our study &shorter version of control "A recent study finds that when parents become more involved in their children's school lives by receiving regular information about their child's academic progress, their children develop more positive behavior in school. Another recent study finds that if the child's father emails the school and indicates that the mother has limited availability, about 90% of responses from the school will be directed to the "	
	gen Dec24_InfoReactT2=0
		replace Dec24_InfoReactT2=1 if InfoExp>90&InfoExp<=100		
	
	gen InfoExpOurStudy=0 
		replace InfoExpOurStudy=1 if Dec24_InfoReactT1==1 	
		replace InfoExpOurStudy=1 if Dec24_InfoReactT2==1 
		
	tabstat Dec24_InfoReactT1 Dec24_InfoReactT2	 Dec24_InfoReactC1 Dec24_InfoReactC2, by(InfoExpOurStudy) stat(mean min max N)

	destring InfoExpFirst, force replace
	
	tab InfoExpOurStudy InfoExpFirst //ideally 25% of sample in each bucket
	
** Note Dad listed first (instead of mom) only matters for the other version of this survey I think where we are surveying decison-makers who interact with households
	//50% liklihood
	
//-------------- Information Experiment ------------//
//Prior Knowledge
gen KnewControlStudy=0
	replace KnewControlStudy=1 if Dec24_ControlPrior=="Yes, I knew this information"
	replace KnewControlStudy=1 if Dec24_TreatPrior1=="Yes, I knew this information"
	ttest KnewControlStudy, by(InfoExpOurStudy)
	
gen KnewTreatmentStudy=.
	replace KnewTreatmentStudy=1 if Dec24_TreatPrior2=="Yes, I knew this information"
	replace KnewTreatmentStudy=0 if Dec24_TreatPrior2=="No, I did not know this information"
	replace KnewTreatmentStudy=1 if Dec24_TreatPrior3=="Yes, I knew this information"
	replace KnewTreatmentStudy=0 if Dec24_TreatPrior3=="No, I did not know this information"	
	replace KnewTreatmentStudy=1 if Dec24_ControlPrior2=="Yes, I knew this information"
	replace KnewTreatmentStudy=0 if Dec24_ControlPrior2=="No, I did not know this information"	
	ttest KnewTreatmentStudy, by(InfoExpOurStudy)
	
//Dec24_Info_ChangeTot
//How does all this information above change how much your household will contact the school?
tab Dec24_Info_ChangeTot if InfoExpOurStudy==0
tab Dec24_Info_ChangeTot if InfoExpOurStudy==1

gen Dec24_Info_ChangeTot_Increase=0
	replace Dec24_Info_ChangeTot_Increase=1 if Dec24_Info_ChangeTot=="Increase a lot"
	replace Dec24_Info_ChangeTot_Increase=1 if Dec24_Info_ChangeTot=="Increase somewhat"
	
ttest Dec24_Info_ChangeTot_Increase, by(InfoExpOurStudy)	//No hypothesis on whether this should differ by C vs. T

//Dec24_Info_ChangeDad
//How will all the information above change the proportion of contact by the father in your household (versus the mother) to the school?
tab Dec24_Info_ChangeDad if InfoExpOurStudy==0
tab Dec24_Info_ChangeDad if InfoExpOurStudy==1
tab Dec24_Info_ChangeDad if InfoExpOurStudy==1&KnewTreatment==0 // 57%

gen Dec24_Info_ChangeDad_Increase=0
	replace Dec24_Info_ChangeDad_Increase=1 if Dec24_Info_ChangeDad=="Increase a lot"
	replace Dec24_Info_ChangeDad_Increase=1 if Dec24_Info_ChangeDad=="Increase somewhat"
	
ttest Dec24_Info_ChangeDad_Increase, by(InfoExpOurStudy)	//Hypothesis Treatment should increase more than control
ttest Dec24_Info_ChangeDad_Increase if KnewTreatmentStudy==0, by(InfoExpOurStudy)	//Hypothesis Treatment should increase more than control
reg Dec24_Info_ChangeDad_Increase InfoExpOurStudy KnewControl KnewTreatmentStudy InfoExpFirst, robust	
reg Dec24_Info_ChangeDad_Increase InfoExpOurStudy KnewControl KnewTreatmentStudy InfoExpFirst [aw=a_weight] , robust	

// Why did people change Open Ended
//brow Dec24_Info_ChangeDad Dec24_Info_Why if InfoExpOurStudy==1

// Why did people NOT CHANGE 
gen WhyNoChangeMom=0 if Dec24_Info_WhyNoChan!="Other (Please explain):" & Dec24_Info_WhyNoChan!=""
	replace WhyNoChangeMom=1 if Dec24_Info_WhyNoChan=="Our household chooses to have the mother handle all requests from some organizations (including schools) while the father handles requests from other organizations."
	replace WhyNoChangeMom=1  if Dec24_Info_WhyNoChan== "Our household chooses to have the mother handle all requests from all organizations."
	
gen WhyNoChangeDad=0 if Dec24_Info_WhyNoChan!="Other (Please explain):" & Dec24_Info_WhyNoChan!=""
	replace WhyNoChangeDad=1 if Dec24_Info_WhyNoChan=="Our household chooses to have the father handle all requests from some organizations (including schools) while the mother handles requests from other organizations."
	replace WhyNoChangeDad=1  if Dec24_Info_WhyNoChan== "Our household chooses to have the father handle all requests from all organizations"	
tab Dec24_Info_WhyNoChan if InfoExpOurStudy==1&KnewTreatment==0
	
fsum WhyNoChangeMom WhyNoChangeDad if InfoExpOurStudy==1&KnewTreatment==0
	
//----------- Stay-at-home Parent ------------//
//Please indicate how strongly you agree or disagree with the statement: Non-routine/unexpected child-related interruptions to my job from external organizations have led me to choose to be a stay-at-home parent
tab Dec24_Lab_StayAtHm1
	tab Dec24_Lab_StayAtHm1 if MotherVFather=="Mother"
	tab Dec24_Lab_StayAtHm1 if MotherVFather=="Father"

destring Dec24_Lab_NegCareer2_4 Dec24_Lab_MoreFlex2_4 Dec24_Lab_LowPay2_4 Dec24_Lab_ShrtComm2_4 Dec24_Lab_StayAtHm2_4 Dec24_Lab_Major2_4 Dec24_Lab_Promotion2_4 Dec24_Lab_DiffFocus2_4 Dec24_Lab_WorseEmp2_4 Dec24_Lab_NegRel2_4 Dec24_Lab_MenPhy2_4, force replace

//Dec24_Lab_StayAtHm2. How much did non-routine/unexpected child-related interruptions to your job(s) by external organizations lead you to choose to be a stay-at-home parent? 0 "Not Very Much" 100 "Ver Much" Also NA option
sum Dec24_Lab_StayAtHm2_4

//How much did non-routine/unexpected child-related interruptions to your job(s) by external organizations negatively contribute to your XXXX?

global IntensityLabChange "Dec24_Lab_NegCareer2_4 Dec24_Lab_MoreFlex2_4 Dec24_Lab_LowPay2_4 Dec24_Lab_ShrtComm2_4 Dec24_Lab_StayAtHm2_4 Dec24_Lab_Major2_4 Dec24_Lab_Promotion2_4 Dec24_Lab_DiffFocus2_4 Dec24_Lab_WorseEmp2_4 Dec24_Lab_NegRel2_4 Dec24_Lab_MenPhy2_4"
//Replace those who chose NA as missing data
foreach var in $IntensityLabChange {
replace `var'=. if `var'==-99
}

fsum Dec24_Lab_NegCareer2_4 Dec24_Lab_MoreFlex2_4 Dec24_Lab_LowPay2_4 Dec24_Lab_ShrtComm2_4 Dec24_Lab_StayAtHm2_4 Dec24_Lab_Major2_4 Dec24_Lab_Promotion2_4 Dec24_Lab_DiffFocus2_4 Dec24_Lab_WorseEmp2_4 Dec24_Lab_NegRel2_4 Dec24_Lab_MenPhy2_4 [aw=a_weight], stat(mean min max N) 

rename Dec24_Employment2b_1 Dec24_Empl2b_CostChildcare
rename Dec24_Employment2b_2 Dec24_Empl2b_AvailChildcare
rename Dec24_Employment2b_3 Dec24_Empl2b_PayEmployed
rename Dec24_Employment2b_4 Dec24_Empl2b_SpendTimeKids
rename Dec24_Employment2b_5 Dec24_Empl2b_ExtOrgInteruptions
rename Dec24_Employment2b_6 Dec24_Empl2b_SocialNorms
rename Dec24_Employment2b_7 Dec24_Empl2b_ReduceCogLoad
rename Dec24_Employment2b_8 Dec24_Empl2b_Other

destring Dec24_Empl2b_*, force replace

fsum Dec24_Empl2b_* [aw=a_weight]
fsum Dec24_Empl2b_* [aw=a_weight] if MotherVFather=="Mother"
fsum Dec24_Empl2b_* [aw=a_weight] if MotherVFather=="Father"
	

//-------------------Have Children
gen TwoParentHetero=0
	replace TwoParentHetero=1 if HaveChildren=="Yes"&HouseholdType=="One mother and one father raising child(ren) in a shared household"
	
gen HH_MotherRespond=.
	replace HH_MotherRespond=0 if MotherVFather!=""
	replace HH_MotherRespond=1 if MotherVFather=="Mother"
label define HH_MotherRespondl ///
					0 "Male" ///
					1 "Female"
label values HH_MotherRespond HH_MotherRespondl		

	
//When you are the first and only person contacted by the organization, what proportion of the time do you contact your partner to help resolve the organization's inquiry? Mark NA if you are never the first and only person contacted by the organization.
	destring OrgOutsource, replace
		replace OrgOutsource=. if OrgOutsource==-99
	ttest OrgOutsource, by(HH_MotherRespond) 	
	tabstat OrgOutsource [aw=a_weight], by(HH_MotherRespond) stat(mean N)	
 	
//When you contact your partner to help resolve the organization's inquiry, approximately how much time out of your day does it take you to contact your partner and/or coordinate the resolution with them? (displays "Minutes" next to text entry)
	destring OrgResolutiontime, replace	
	tabstat OrgResolutiontime, by(HH_MotherRespond) stat(mean p50 N)
	//ttest OrgResolutiontime [aw=a_weight], by(HH_MotherRespond)
	gen Resolutiontime=OrgResolutiontime if OrgResolutiontime!=.
	ttest Resolutiontime, by(HH_MotherRespond)
		
//When you contact your partner to help resolve the organization's inquiry, how disruptive to your day is this?
//tab OrgDisruption
//tab SchDisruption

gen DisruptionVerySomewhat=.
	replace DisruptionVerySomewhat=1 if OrgDisruption=="Very disruptive"
	replace DisruptionVerySomewhat=1 if OrgDisruption=="Somewhat disruptive"
	replace DisruptionVerySomewhat=0 if OrgDisruption=="Mildly disruptive"
	replace DisruptionVerySomewhat=0 if OrgDisruption=="Not disruptive"
	ttest DisruptionVerySomewhat,  by(HH_MotherRespond)
	
	
//When you contact your partner to help resolve the organization's inquiry, what proportion of the time does your partner completely resolve the issue without any further involvement by you?
	destring OrgPartnerresolution, replace
		replace OrgPartnerresolution=. if OrgPartnerresolution==-99
	tabstat OrgPartnerresolution, by(HH_MotherRespond)
	//ttest OrgPartnerresolution [aw=a_weight], by(HH_MotherRespond)
	
//What proportion of the time would you and your partner ideally like to be contacted by the organization?

//We are going to list some common organizations below. How much do you wish each of these organizations contacted you vs. your partner? If your household does not interact with a specific type of organization please select "non-applicable".

global OrgVars "OrgProportion Dec24_InstSpecSplits_1 Dec24_InstSpecSplits_2 Dec24_InstSpecSplits_3 Dec24_InstSpecSplits_4 Dec24_InstSpecSplits_5 Dec24_InstSpecSplits_6 Dec24_InstSpecSplits_7 Dec24_InstSpecSplits_8 Dec24_InstSpecSplits_9 Dec24_InstSpecSplits_10"


foreach var in $OrgVars{
gen `var'Me=.
	replace `var'Me=0 if `var'=="0% me, 100% my partner"
	replace `var'Me=10 if `var'=="10% me, 90% my partner"
	replace `var'Me=20 if `var'=="20% me, 80% my partner"
	replace `var'Me=30 if `var'=="30% me, 70% my partner"
	replace `var'Me=40 if `var'=="40% me, 60% my partner"
	replace `var'Me=50 if `var'=="50% me, 50% my partner"
	replace `var'Me=60 if `var'=="60% me, 40% my partner"
	replace `var'Me=70 if `var'=="70% me, 30% my partner"
	replace `var'Me=80 if `var'=="80% me, 20% my partner"
	replace `var'Me=90 if `var'=="90% me, 10% my partner"
	replace `var'Me=100 if `var'=="100% me, 0% my partner"	
	
	replace `var'Me=. if `var'=="Non-Applicable"
	
}	


//Consider the time spent being contacted by all the organizations combined (for example, school, child care center, doctor's office, sports coaches, extracurricular activities). What proportion of that time would you and your partner want to be contacted by all those organizations combined?	
label var OrgProportionMe "Wish Contacted Over ALL Organizations"
	tabstat OrgProportionMe, by(HH_MotherRespond)	
	histogram OrgProportionMe , by(HH_MotherRespond)
	cd "$output"
*graph export "OurSurveyAllOrgSplit.png", as(png) replace 
	
//In practice, please describe in your own words how you might you implement the split you described before. :	
// brow Dec24_OpenHowSplit

//Now, we'd like you to tell us which of the following best describes the way you might implement the split you described before (select all that apply):
	gen Dec24_HowSplitSelect=.
	replace Dec24_HowSplitSelect=1 if Dec24_HowSplitSelect_4!="0"	
	//Split by asking all organizations to contact one parent as the default (for all organizations) and then call the other parent immediately afterwards if can't reach the default parent
	replace Dec24_HowSplitSelect=2 if Dec24_HowSplitSelect_5!="0"	
	//Split by having one dedicated family phone number which you switch whether you or partner are in charge of answering
	replace Dec24_HowSplitSelect=3 if Dec24_HowSplitSelect_6!="0"	
	
	label define Dec24_HowSplitSelectl ///
						1 "Ask All Orgs Contact 1 Parent" ///
						2 "Dedicated Family Phone Number" ///
						3 "Other" 
	label values Dec24_HowSplitSelect Dec24_HowSplitSelectl	
	tab Dec24_HowSplitSelect
	
// We are going to list some common organizations below. How much do you wish each of these organizations contacted you vs. your partner? If your household does not interact with a specific type of organization please select "non-applicable".
	rename Dec24_InstSpecSplits_1Me Dec24S_SportsProportion_Me
	rename Dec24_InstSpecSplits_2Me Dec24S_TutoringProportion_Me
	rename Dec24_InstSpecSplits_3Me Dec24S_MedDentalProportion_Me
	rename Dec24_InstSpecSplits_4Me Dec24S_ExtraNSportProportion_Me
	rename Dec24_InstSpecSplits_5Me Dec24S_SchoolProportion_Me
	rename Dec24_InstSpecSplits_6Me Dec24S_ChildcareProportion_Me
	rename Dec24_InstSpecSplits_7Me Dec24S_ReligiousProportion_Me	
	rename Dec24_InstSpecSplits_8Me Dec24S_LawEnforceProportion_Me
	rename Dec24_InstSpecSplits_9Me Dec24S_ExtendedFamProportion_Me	
	rename Dec24_InstSpecSplits_10Me Dec24S_OtherProportion_Me
	
label var Dec24S_SportsProportion_Me "Sports"
label var Dec24S_TutoringProportion_Me "Tutoring"
label var Dec24S_MedDentalProportion_Me "Medical/Dental"
label var Dec24S_ExtraNSportProportion_Me "Extracurricular (Not Sports)"
label var Dec24S_SchoolProportion_Me "School"
label var Dec24S_ChildcareProportion_Me "Childcare Provider"
label var Dec24S_ReligiousProportion_Me "Religious"
label var Dec24S_LawEnforceProportion_Me "Law Enforcement"
label var Dec24S_ExtendedFamProportion_Me "Extended Family"
label var Dec24S_OtherProportion_Me "Other"

global OrgVars2 "SportsProportion TutoringProportion MedDentalProportion ExtraNSportProportion SchoolProportion ChildcareProportion ReligiousProportion LawEnforceProportion ExtendedFamProportion OtherProportion"	

gen OrgProportion5050=0
	replace OrgProportion5050=1 if OrgProportionMe==50

label define OrgProportion5050l ///
	0 "Not 50-50 Wanted" ///
	1 "50-50 Wanted"
label values OrgProportion5050 OrgProportion5050l


	
	fsum OrgProportionMe Dec24S* [aw=a_weight] if HH_MotherRespond==1
	fsum OrgProportionMe Dec24S*  [aw=a_weight] if HH_MotherRespond==0	
	
//If you inform the organization of your ideal arrangement, how difficult is it to ensure that the organization consistently honors it?
gen OrgSchHonorsEasy=.
	replace OrgSchHonorsEasy=1 if 	OrgHonors=="Extremely easy"
	replace OrgSchHonorsEasy=1 if 	OrgHonors=="Somewhat easy"
	replace OrgSchHonorsEasy=0 if 	OrgHonors=="Neutral"
	replace OrgSchHonorsEasy=0 if 	OrgHonors=="Somewhat difficult"
	replace OrgSchHonorsEasy=0 if 	OrgHonors=="Extremely difficult"	
	
	
gen OrgSchHonorsDifficult=.
	replace OrgSchHonorsDifficult=0 if 	OrgHonors=="Extremely easy"
	replace OrgSchHonorsDifficult=0 if 	OrgHonors=="Somewhat easy"
	replace OrgSchHonorsDifficult=0 if 	OrgHonors=="Neutral"
	replace OrgSchHonorsDifficult=1 if 	OrgHonors=="Somewhat difficult"
	replace OrgSchHonorsDifficult=1 if 	OrgHonors=="Extremely difficult"	
	
	tabstat OrgSchHonorsEasy OrgSchHonorsDifficult [aw=a_weight], by(HH_MotherRespond)	
	

//Suppose you and your partner each want to be contacted by a particular organization about half the time. How many times would you need to remind the organization of this wish for them to consistently honor it?
tab OrgReminder

//How many times per year on average do you engage in the process of stating your contact preference and reminding a person/organization about them?
destring Orgtimesremind, replace
tabstat Orgtimesremind , by(HH_MotherRespond)	
tabstat Orgtimesremind [aw=a_weight], by(HH_MotherRespond)	

//Suppose that your partner does the majority of interacting with the organization (for example, drops the kids off and picks them up). What proportion of the time does the organization still contact you with a child-related inquiry?
destring OrgPartnermajor, replace
	replace OrgPartnermajor=. if OrgPartnermajor==-99
tabstat OrgPartnermajor, by(HH_MotherRespond)		
tabstat OrgPartnermajor [aw=a_weight], by(HH_MotherRespond)		
	
//What proportion of your household's interactions about child-related external demands come from organizations that are unable to consistently honor your household's preferences on who they should contact?	
destring OrgInability, replace
	replace OrgInability=. if OrgInability==-99
tabstat OrgInability, by(HH_MotherRespond)
tabstat OrgInability [aw=a_weight], by(HH_MotherRespond)



//Please indicate how strongly you agree or disagree with each of the following statements.

global LabMarketVars "Dec24_Lab_NegCareer Dec24_Lab_MoreFlex Dec24_Lab_LowPay Dec24_Lab_ShrtComm Dec24_Lab_StayAtHm Dec24_Lab_Major Dec24_Lab_Promotion Dec24_Lab_DiffFocus Dec24_Lab_WorseEmp Dec24_Lab_NegRel Dec24_Lab_MenPhy"

foreach var in $LabMarketVars{
	gen LabCont_`var'=0 if `var'1=="Strongly Disagree"
	replace LabCont_`var'=1 if `var'1=="Disagree"
	replace LabCont_`var'=2 if `var'1=="Neutral"
	replace LabCont_`var'=3 if `var'1=="Agree"
	replace LabCont_`var'=4 if `var'1=="Strongly Agree"
	
	gen LabAgree_`var'=0 if `var'1=="Strongly Disagree"
	replace LabAgree_`var'=0 if `var'1=="Disagree"
	replace LabAgree_`var'=0 if `var'1=="Neutral"
	replace LabAgree_`var'=1 if `var'1=="Agree"
	replace LabAgree_`var'=1 if `var'1=="Strongly Agree"	
}

		
fsum LabCont* [aw=a_weight] if HH_MotherRespond==1
fsum LabCont* [aw=a_weight] if HH_MotherRespond==0

fsum LabAgree* [aw=a_weight] if HH_MotherRespond==1
fsum LabAgree* [aw=a_weight] if HH_MotherRespond==0

foreach var in $LabMarketVars{
	ttest LabAgree_`var', by(HH_MotherRespond)
}
	
gen LabMat01_CareerTrajectory=LabAgree_Dec24_Lab_NegCareer
	label var LabMat01_CareerTrajectory "negatively impacted my career trajectory"
gen LabMat02_FlexiblibleJob=LabAgree_Dec24_Lab_MoreFlex
	label var LabMat02_FlexiblibleJob "more flexibility"	
gen LabMat03_LowerPay=LabAgree_Dec24_Lab_LowPay
	label var LabMat03_LowerPay "lower pay"	
gen LabMat04_ShortCommute=LabAgree_Dec24_Lab_ShrtComm
	label var LabMat04_ShortCommute "shorter commute"
gen LabMat05_StayAtHome=LabAgree_Dec24_Lab_StayAtHm
	label var LabMat05_StayAtHome "stay-at-home parent"	
gen LabMat06_DiffMajor=LabAgree_Dec24_Lab_Major
	label var LabMat06_DiffMajor "different college major"	
gen LabMat07_LessPromotion=LabAgree_Dec24_Lab_Promotion
	label var LabMat07_LessPromotion "less likely promoted"	
gen LabMat08_DifficultFocus=LabAgree_Dec24_Lab_DiffFocus
	label var LabMat08_DifficultFocus "difficult to focus"	
gen LabMat09_WorseEmployee=LabAgree_Dec24_Lab_WorseEmp
	label var LabMat09_WorseEmployee "worse employee"
gen LabMat10_NegHealth=LabAgree_Dec24_Lab_MenPhy
	label var LabMat10_NegHealth "neg effect health"	
gen LabMat11_NegPartnerRel=LabAgree_Dec24_Lab_NegRel
	label var LabMat11_NegPartnerRel "neg effect partner relationship"		

global LabMatVars "LabMat01_CareerTrajectory LabMat02_FlexiblibleJob LabMat03_LowerPay LabMat04_ShortCommute LabMat05_StayAtHome LabMat06_DiffMajor LabMat07_LessPromotion LabMat08_DifficultFocus LabMat09_WorseEmployee LabMat10_NegHealth LabMat11_NegPartnerRel"	
	
foreach var in $LabMatVars {
ttest `var', by(HH_MotherRespond)
reg `var' HH_MotherRespond [aw=a_weight], robust
estimates store `var'	
}	

	esttab 	LabMat01_CareerTrajectory LabMat02_FlexiblibleJob LabMat03_LowerPay LabMat04_ShortCommute LabMat05_StayAtHome LabMat06_DiffMajor LabMat07_LessPromotion, star 	
	esttab  LabMat08_DifficultFocus LabMat09_WorseEmployee LabMat10_NegHealth LabMat11_NegPartnerRel, star

tabstat $LabMatVars , by(HH_MotherRespond)	stat(mean) format(%9.2fc) //unweighted 	
tabstat $LabMatVars [aw=a_weight], by(HH_MotherRespond)	stat(mean) format(%9.2fc)  //weighted to match population levels of stay at home moms and dads
	
esttab 	LabMat* , star
save, replace


// Version with weighting
sort HH_MotherRespond ResponseId	
bysort HH_MotherRespond : gen running=_n

gen LabMatAll=.
gen LabMatAllhi=.
gen LabMatAlllow=.

local i 1
foreach var in $LabMatVars {	
gen mean`var'=.
gen SD`var'=.
gen N`var'=.
summarize `var' [aw=a_weight] if HH_MotherRespond == 1, detail
	replace mean`var'=r(mean) if HH_MotherRespond == 1
	replace SD`var'=r(sd) if HH_MotherRespond == 1
	replace N`var'=r(N) if HH_MotherRespond == 1
summarize `var' [aw=a_weight] if HH_MotherRespond == 0, detail
	replace mean`var'=r(mean) if HH_MotherRespond == 0
	replace SD`var'=r(sd) if HH_MotherRespond == 0
	replace N`var'=r(N) if HH_MotherRespond == 0	
//bysort 	HH_MotherRespond: egen mean`var'= mean(`var') 
//bysort 	HH_MotherRespond: egen SD`var'= sd(`var') 
//bysort 	HH_MotherRespond: egen N`var'= count(`var') 

generate hi`var' = mean`var' + invttail(N`var'-1,0.025)*(SD`var' / sqrt(N`var'))
generate low`var' = mean`var' - invttail(N`var'-1,0.025)*(SD`var' / sqrt(N`var')) 

replace LabMatAll=mean`var' if HH_MotherRespond==0&running==`i'
replace LabMatAll=mean`var' if HH_MotherRespond==1&running==`i'

replace LabMatAllhi=hi`var' if HH_MotherRespond==0&running==`i'
replace LabMatAllhi=hi`var' if HH_MotherRespond==1&running==`i'

replace LabMatAlllow=low`var' if HH_MotherRespond==0&running==`i'
replace LabMatAlllow=low`var' if HH_MotherRespond==1&running==`i'

display `i'
local i=`i'+ 1
}

tabstat LabMatAll if HH_MotherRespond==1&running<=11 [aw=a_weight], by(running)
tabstat LabMatAll if HH_MotherRespond==0&running<=11 [aw=a_weight], by(running)


gen Question=.
	replace Question=1 if HH_MotherRespond==0&running==2
	replace Question=2 if HH_MotherRespond==1&running==2
	
	replace Question=4 if HH_MotherRespond==0&running==4
	replace Question=5 if HH_MotherRespond==1&running==4
	
	replace Question=7 if HH_MotherRespond==0&running==5
	replace Question=8 if HH_MotherRespond==1&running==5
	
	replace Question=10 if HH_MotherRespond==0&running==3
	replace Question=11 if HH_MotherRespond==1&running==3
	
	replace Question=13 if HH_MotherRespond==0&running==8
	replace Question=14 if HH_MotherRespond==1&running==8
	
	replace Question=16 if HH_MotherRespond==0&running==1
	replace Question=17 if HH_MotherRespond==1&running==1
	
	replace Question=19 if HH_MotherRespond==0&running==7
	replace Question=20 if HH_MotherRespond==1&running==7
	
	replace Question=22 if HH_MotherRespond==0&running==11
	replace Question=23 if HH_MotherRespond==1&running==11
	
	replace Question=25 if HH_MotherRespond==0&running==10
	replace Question=26 if HH_MotherRespond==1&running==10
	
	replace Question=28 if HH_MotherRespond==0&running==9
	replace Question=29 if HH_MotherRespond==1&running==9
	
	replace Question=31 if HH_MotherRespond==0&running==6
	replace Question=32 if HH_MotherRespond==1&running==6
	
	
label define Questionl ///
					1 "more flexibility" ///
					4 "shorter commute" ///
					7 "stay-at-home parent"	///
					10  "lower pay"	///
					13 "difficult to focus"	///
					16 "neg impacted my career trajectory" ///
					19 "less likely promoted"	///
					22 "neg effect partner relationship" ///
					25 "neg effect health"	///
					28  "worse employee" ///
					31 "different college major"	
label values Question Questionl	 		

twoway 	(bar  LabMatAll Question if HH_MotherRespond==0&running<=11, bcolor(ltblue)) ///
		(bar  LabMatAll Question if HH_MotherRespond==1&running<=11, bcolor(orange) sort(LabMatAll)) ///
        (rcap LabMatAllhi LabMatAlllow Question if HH_MotherRespond==0&running<=11, lcolor(black))  /// 
        (rcap LabMatAllhi LabMatAlllow Question if HH_MotherRespond==1&running<=11, lcolor(black)) ///
		,	xlabel(1 4 7 10 13 16 19 22 25 28 31 , valuelabe angle(45)) ///
	legend( order( 1 "Male" 2 "Female" ) )


graph export "$figures/Figure_5.png", replace width(1000)



